cogl_pango_font_map_set_use_mipmapping (fontmap, FALSE);
}
+static void
+shell_profiler_init (void)
+{
+ ShellGlobal *global;
+ GjsProfiler *profiler;
+ GjsContext *context;
+ const char *enabled;
+ const char *fd_str;
+ int fd = -1;
+
+ /* Sysprof uses the "GJS_TRACE_FD=N" environment variable to connect GJS
+ * profiler data to the combined Sysprof capture. Since we are in control of
+ * the GjsContext, we need to proxy this FD across to the GJS profiler.
+ */
+
+ fd_str = g_getenv ("GJS_TRACE_FD");
+ enabled = g_getenv ("GJS_ENABLE_PROFILER");
+ if (fd_str == NULL || enabled == NULL)
+ return;
+
+ global = shell_global_get ();
+ g_return_if_fail (global);
+
+ context = _shell_global_get_gjs_context (global);
+ g_return_if_fail (context);
+
+ profiler = gjs_context_get_profiler (context);
+ g_return_if_fail (profiler);
+
+ if (fd_str)
+ {
+ fd = atoi (fd_str);
+
+ if (fd > 2)
+ {
+ gjs_profiler_set_fd (profiler, fd);
+ gjs_profiler_start (profiler);
+ }
+ }
+}
+
+static void
+shell_profiler_shutdown (void)
+{
+ ShellGlobal *global;
+ GjsProfiler *profiler;
+ GjsContext *context;
+
+ global = shell_global_get ();
+ context = _shell_global_get_gjs_context (global);
+ profiler = gjs_context_get_profiler (context);
+
+ if (profiler)
+ gjs_profiler_stop (profiler);
+}
+
static void
malloc_statistics_callback (ShellPerfLog *perf_log,
gpointer data)
dump_gjs_stack_on_signal (SIGSEGV);
}
+ shell_profiler_init ();
ecode = meta_run ();
+ shell_profiler_shutdown ();
g_debug ("Doing final cleanup");
_shell_global_destroy_gjs_context (shell_global_get ());